package com.yoomiito.app.ui.welcome

import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.yoomiito.app.Constant
import com.yoomiito.app.R
import com.yoomiito.app.base.App
import com.yoomiito.app.base.BaseActivity
import com.yoomiito.app.model.config.SystemInfo
import com.yoomiito.app.present.SystemInfoPresenter
import kotlinx.android.synthetic.main.act_system_info.*

/**
 * 显示系统通知
 */
class SystemInfoActivity : BaseActivity<SystemInfoPresenter>() {

    companion object{
        fun start(context: Context,systemInfo:SystemInfo){
            val intent = Intent(context,SystemInfoActivity::class.java)
            intent.putExtra(Constant.DATA,systemInfo)
            context.startActivity(intent)
        }
    }

    override fun getLayoutId(): Int = R.layout.act_system_info

    override fun newP(): SystemInfoPresenter = SystemInfoPresenter(App.mAppConfig)

    override fun initData(savedInstanceState: Bundle?) {
        val systemInfo = intent.getParcelableExtra<SystemInfo>(Constant.DATA)
        msg_1.text = systemInfo.title
        msg_2.text = systemInfo.vice_title
        date.text = systemInfo.title_time
    }
}